#ifndef _SYS_DATE_TIME_H_
#define _SYS_DATE_TIME_H_

#include "FanObj.h"
#include "SysTypes.h"

#define DATE_TIME_VTABLE(self)   ((DateTimeVTable*)((FanObj*)self)->vtable)


extern Type*    DateTime_classType;
extern VTable*  DateTime_classVTable;


/* [sys::DateTime] Attributes */
struct DateTime
{
  FanObj        super;
};


/* [sys::DateTime] Virtual-table */
typedef struct DateTimeVTable
{
  FanObjVTable  super;
} DateTimeVTable;


/* [sys::DateTime] Methods and fields */
Bool            DateTime_equals(Obj self, NullableObj that);
Int             DateTime_compare(Obj self, Obj obj);
Int             DateTime_hash(Obj self);
Str*            DateTime_toStr(Obj self);
DateTime*       DateTime_defVal(void);
DateTime*       DateTime_now_0(void);
DateTime*       DateTime_now(Duration* tolerance);
DateTime*       DateTime_nowUtc_0(void);
DateTime*       DateTime_nowUtc(Duration* tolerance);
Int             DateTime_nowTicks(void);
Int             DateTime_nowUnique(void);
DateTime*       DateTime_makeTicks_1(Int ticks);
DateTime*       DateTime_makeTicks(Int ticks, TimeZone* tz);
DateTime*       DateTime_make_5(Int year, Month* month, Int day, Int hour, Int min);
DateTime*       DateTime_make_6(Int year, Month* month, Int day, Int hour, Int min, Int sec);
DateTime*       DateTime_make_7(Int year, Month* month, Int day, Int hour, Int min, Int sec, Int ns);
DateTime*       DateTime_make(Int year, Month* month, Int day, Int hour, Int min, Int sec, Int ns, TimeZone* tz);
DateTime*       DateTime_fromStr_1(Str* s);
DateTime*       DateTime_fromStr(Str* s, Bool checked);
DateTime*       DateTime_boot(void);
Int             DateTime_ticks(DateTime* self);
Date*           DateTime_date(DateTime* self);
Time*           DateTime_time(DateTime* self);
Int             DateTime_year(DateTime* self);
Month*          DateTime_month(DateTime* self);
Int             DateTime_day(DateTime* self);
Int             DateTime_hour(DateTime* self);
Int             DateTime_min(DateTime* self);
Int             DateTime_sec(DateTime* self);
Int             DateTime_nanoSec(DateTime* self);
Weekday*        DateTime_weekday(DateTime* self);
TimeZone*       DateTime_tz(DateTime* self);
Bool            DateTime_dst(DateTime* self);
Str*            DateTime_tzAbbr(DateTime* self);
Int             DateTime_dayOfYear(DateTime* self);
Str*            DateTime_toLocale_0(DateTime* self);
Str*            DateTime_toLocale(DateTime* self, Str* pattern);
DateTime*       DateTime_fromLocale_2(Str* str, Str* pattern);
DateTime*       DateTime_fromLocale_3(Str* str, Str* pattern, TimeZone* tz);
DateTime*       DateTime_fromLocale(Str* str, Str* pattern, TimeZone* tz, Bool checked);
DateTime*       DateTime_toTimeZone(DateTime* self, TimeZone* tz);
DateTime*       DateTime_toUtc(DateTime* self);
DateTime*       DateTime_toRel(DateTime* self);
Duration*       DateTime_minusDateTime(DateTime* self, DateTime* time);
DateTime*       DateTime_plus(DateTime* self, Duration* duration);
DateTime*       DateTime_minus(DateTime* self, Duration* duration);
DateTime*       DateTime_floor(DateTime* self, Duration* accuracy);
DateTime*       DateTime_midnight(DateTime* self);
Bool            DateTime_isMidnight(DateTime* self);
Bool            DateTime_isLeapYear(Int year);
Int             DateTime_weekdayInMonth(Int year, Month* mon, Weekday* weekday, Int pos);
DateTime*       DateTime_fromJava_1(Int millis);
DateTime*       DateTime_fromJava(Int millis, TimeZone* tz);
Int             DateTime_toJava(DateTime* self);
DateTime*       DateTime_fromIso_1(Str* s);
DateTime*       DateTime_fromIso(Str* s, Bool checked);
Str*            DateTime_toIso(DateTime* self);
DateTime*       DateTime_fromHttpStr_1(Str* s);
DateTime*       DateTime_fromHttpStr(Str* s, Bool checked);
Str*            DateTime_toHttpStr(DateTime* self);
Str*            DateTime_toCode(DateTime* self);


/* [sys::DateTime] Type-system functions */
Type*           DateTime_initType(void);
VTable*         DateTime_initVTable(void);
void            DateTime_initStatic(void);


#endif
